package text1;

/**
 * Created with IntelliJ IDEA.
 * Description:
 */
public class Text {
    public static void main(String[] args) {
        String s ="one";
        int ret =switch (s){
            case "one" -> 1 ;
            case "two"-> 2;
            default -> -1;
        };
        System.out.println(ret);
    }
    public static void main2(String[] args) {
        String s ="one";
        //int ret =0;
        int ret =switch (s){
            case "one" : yield  1 ;
            case "two":yield 2;
            default: yield -1;
        };
        System.out.println(ret);
    }
    public static void main1(String[] args) {
        String s ="one";
        int ret =0;
        switch (s){
            case "one":
                ret =1;
                break;
            case "two":
                ret =2;
                break;
            default:
                ret =-1;
                break;
        }
        System.out.println(ret);
    }
}
